package com.wenx.v3system.modular.cloud.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wenx.v3system.modular.cloud.domain.po.SysPermission;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 系统权限Mapper接口
 * 
 * @author wenx
 * @since 1.0.0
 */
public interface SysPermissionMapper extends BaseMapper<SysPermission> {

    /**
     * 根据权限代码获取权限ID
     * 
     * @param permissionCode 权限代码
     * @return 权限ID
     */
    @Select("SELECT id FROM sys_permission WHERE code = #{permissionCode} AND status = 1 AND deleted = 0 LIMIT 1")
    Long selectIdByCode(@Param("permissionCode") String permissionCode);
}